﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;

namespace Ares.Engine
{
    /// <summary>
    /// Raised if the revert parameter is unparsable
    /// </summary>
    [Serializable]
    public class RevertParameterException : System.Exception
    {
        private string fRevertParameter;

        public RevertParameterException()
        {
        }

        public RevertParameterException(string message)
            : base(message)
        {
        }

        public RevertParameterException(string message,
            Exception innerException)
            : base(message, innerException)
        {
        }

        protected RevertParameterException(SerializationInfo info,
            StreamingContext context)
            : base(info, context)
        {
            if (info != null)
            {
                this.fRevertParameter = info.GetString("fRevertParameter");
            }
        }

        public string RevertParameter
        {
            get { return this.fRevertParameter; }
            set { this.fRevertParameter = value; }
        }

        public override void GetObjectData(SerializationInfo info,
            StreamingContext context)
        {
            base.GetObjectData(info, context);

            if (info != null)
            {
                info.AddValue("fRevertParameter", this.fRevertParameter);
            }
        }
    }
}
